﻿namespace Compass.Maui.Services;

public interface IPreferenceService
{
    int Get(string key, int defaultValue);
    void Set(string key, int value);
    string Get(string key, string defaultValue);
    void Set(string key, string value);
    DateTime Get(string key, DateTime defaultValue);
    void Set(string key, DateTime value);
}

public class PreferencesService:IPreferenceService
{
    public int Get(string key, int defaultValue)=> Preferences.Get(key, defaultValue);
    public void Set(string key, int value)=> Preferences.Set(key, value);

    public string Get(string key, string defaultValue)=>Preferences.Get(key, defaultValue);

    public void Set(string key, string value) => Preferences.Set(key, value);

    public DateTime Get(string key, DateTime defaultValue) => Preferences.Get(key, defaultValue);
    public void Set(string key, DateTime value) => Preferences.Set(key, value);
}